package com.example.controller;

import com.example.common.Result;
import com.example.entity.Booking;
import com.example.service.NotificationService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 通知控制器，用于获取系统最新通知
 */
@RestController
@RequestMapping("/notification")
public class NotificationController {
    
    @Resource
    private NotificationService notificationService;
    
    /**
     * 获取最新预订通知
     */
    @GetMapping("/latest-booking")
    public Result getLatestBookingNotification() {
        Booking latestBooking = notificationService.getLatestBookingNotification();
        return Result.success(latestBooking);
    }
    
    /**
     * 获取最新预订状态更新通知
     */
    @GetMapping("/latest-booking-update")
    public Result getLatestBookingUpdateNotification() {
        Booking latestUpdate = notificationService.getLatestBookingUpdateNotification();
        return Result.success(latestUpdate);
    }
} 